import 'package:flame/components.dart';
import 'package:flame/events.dart';
import 'package:flutter_flame/component/ScaleSpriteComponent.dart';
import '../../../config/AssetsName.dart';

class SelectorScreenNotesComponent extends PositionComponent {
  @override
  Future<void> onLoad() async {
    position = Vector2(220, 235);
    add(_SelectorScreenHelp1());
    add(_SelectorScreenOptions1());
    add(_SelectorScreenQuit1());
  }
}

class _SelectorScreenHelp1 extends ScaleSpriteComponent with HoverCallbacks {
  _SelectorScreenHelp1()
    : super(50, Vector2(90, 45), AssetsName.spriteSelectorScreenHelp1);
  final highlight = _SelectorScreenHelp2();

  @override
  void onHoverEnter() {
    add(highlight);
    super.onHoverEnter();
  }

  @override
  void onHoverExit() {
    remove(highlight);
    super.onHoverExit();
  }
}

class _SelectorScreenOptions1 extends ScaleSpriteComponent with HoverCallbacks {
  _SelectorScreenOptions1()
    : super(84, Vector2(-5, 0), AssetsName.spriteSelectorScreenOptions1);
  final highlight = _SelectorScreenOptions2();

  @override
  void onHoverEnter() {
    add(highlight);
    super.onHoverEnter();
  }

  @override
  void onHoverExit() {
    remove(highlight);
    super.onHoverExit();
  }
}

class _SelectorScreenQuit1 extends ScaleSpriteComponent with HoverCallbacks {
  _SelectorScreenQuit1()
    : super(50, Vector2(175, 32), AssetsName.spriteSelectorScreenQuit1);
  final highlight = _SelectorScreenQuit2();

  @override
  void onHoverEnter() {
    add(highlight);
    super.onHoverEnter();
  }

  @override
  void onHoverExit() {
    remove(highlight);
    super.onHoverExit();
  }
}

class _SelectorScreenHelp2 extends ScaleSpriteComponent {
  _SelectorScreenHelp2()
    : super(50, Vector2.zero(), AssetsName.spriteSelectorScreenHelp2);
}

class _SelectorScreenOptions2 extends ScaleSpriteComponent {
  _SelectorScreenOptions2()
    : super(84, Vector2.zero(), AssetsName.spriteSelectorScreenOptions2);
}

class _SelectorScreenQuit2 extends ScaleSpriteComponent {
  _SelectorScreenQuit2()
    : super(50, Vector2.zero(), AssetsName.spriteSelectorScreenQuit2);
}
